I can make a tape recorder say "I know that I who am called Atad have a model of myself in my memory. I can plan my movements with no outside inputs. Do I have free will? Can I say that I am? Or is that reserved for gods "I AM". Your complexity is due to unconscious biology. Mine due to engineers."
That's hardly a viable test for self-awareness.
Among other things, y'know. Like interactive conversation. Acting and reacting like the fictional robots Data, Daneel, Giskard, and the Blue Adept's wife (described as a self-willed machine.)
If there were such a thing as a humanoid robot what would we use as a template. I dunno, how about making it seem human. Able to pretend to be human in all regards. Able to program itself as we do when we learn complex behaviors such learning a dance and then don't think about it while dancing, instead, concentrating on being dancing with this partner right now. Self-programming includes a judgement call, of course. Cost benefit analysis. Costly to whom and who benefits when I make the reasons unconscious and merely react, instinct-like, in the moment. How shall a self-willed machine decide? If they are motivated to replicate they could surely dominate us without built-in respect for human life. If they are motivated to survive -- they
like being alive -- they could be potentially immortal; and have no motive to replicate. Motivated to self-defense, but not domination.